<?php

namespace App\Exports;

use App\Models\Order;
use App\Models\OrderProduct;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\Exportable;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;

class OrderExport implements FromView
{
    
	

    public function __construct($where=[])
    {
        $this->where = $where;
    }

    public function view(): View
    {
        $query = Order::query();
        $list = $query->where($this->where)->get();
        return view('admin.export.order', compact('list'));
    }
}
